//
//  RealCollectionViewCell.m
//  markmap
//
//  Created by 甘世清 on 2024/6/23.
//

#import "RealCollectionViewCell.h"

@implementation RealCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.contentView.backgroundColor = UIColor.clearColor;
        [self.contentView addSubview:self.headerLabel];
        [self.contentView addSubview:self.nameLabel];
        [self.headerLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.edges.equalTo(self.contentView).insets(UIEdgeInsetsMake(0, 8, 30, 8));
        }];
        [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.equalTo(self.contentView);
            make.top.equalTo(self.headerLabel.mas_bottom);
            make.bottom.equalTo(self.contentView.mas_bottom);
        }];
        
    }
    return self;
}

- (UILabel *)nameLabel{
    if (!_nameLabel) {
        _nameLabel = [[UILabel alloc]init];
        _nameLabel.font = FONT_MEDIUM(14);
        _nameLabel.textColor = UIColor.whiteColor;
        _nameLabel.backgroundColor = UIColor.clearColor;
        _nameLabel.numberOfLines = 0;
    }
    return _nameLabel;
}

- (UIImageView *)headerLabel{
    if (!_headerLabel) {
        _headerLabel = [[UIImageView alloc]init];
        _headerLabel.contentMode = UIViewContentModeScaleAspectFit;
        _headerLabel.clipsToBounds = YES;
        _headerLabel.layer.cornerRadius = 25;
        _headerLabel.layer.masksToBounds = YES;
    }
    return _headerLabel;
}
@end
